(1) Field of the Invention
This invention relates to a method and apparatus for suspending and resuming the execution of an application program during a power off/on cycle, which are applied to computer systems such as personal computers and workstations.
(2) Description of the Related Art
In former computer systems, memory or registers provided to the systems could not hold data once the systems were powered off so that the previous status could not be resumed even when the systems were powered back on, if the power was turned off during the execution of a program.
Therefore, the user, when desired to power off during the operation and to restart it at a later time, needed to perform the operations as shown in FIG. 1 (a) and in the following, before powering off and after powering back on.
(Before powering off)
(1) Store the document being processed into a floppy disk PA1 (2) Terminate the execution of the word processing program PA1 (3) Set the floppy disk and start the operating system from the beginning (for example, MICRO SOFT MS-DOS) PA1 (4) Start the word processing program PA1 (5) Retrieve the stored document to process
(After powering back on)
Some of the recently developed portable personal computers named book type or notebook type have the function called resume function. This enables the user to restart his operation at the exact execution point at which it is suspended during a power off operation, thereby bypassing the above procedure. All the user has to do is to power off/on at any desired point as shown in FIG. 1 (b).
Toshiba "DynaBook guide" says such a function is implemented by employing a battery built in the personal computer.
Such a personal computer seems to have a construction shown in FIG. 2 where a power unit 5006 having a battery 5008 is connected with an external power unit 5007 and a power switch 5112, and supplies power to a control board 5001, a display device 5105, an input device 5106, and an external storage unit 5005. The control board 5001 mounts a Central Processing Unit (CPU) 5101, a memory 5102, a display control unit 5002, an external storage controller 5003, and an input control unit 5004 thereon.
When the power switch 5112 is on, the power unit 5006 is supplied power from the external power unit 5007, and supplies the power to each unit of the personal computer and charges the battery 5008. If there is no supply from the external power unit 5007 (for example, not connected), it supplies power from the battery 5008 to each unit.
In contrast, when the power switch 5112 is off, the power unit 5006 supplies power from the battery 5008 only to the control board 5001 whether or not it is supplied power from the external power unit 5007. During this time, the entire operation of the personal computer appears to be off with no display on the display device 5105 and no operation in the external storage unit 5005.
However, the data necessary to resume the execution of a program which was running at the time it was powered off as those stored in the memory 5102 or registers in the CPU 5101 is retained even after the switch 5112 has been turned off because the control board 5001 is supplied power from the battery as mentioned.
When the user turns on the power switch 5112 again at a later time, the display device 5105, the input device 5106, and the external storage unit 5005 are supplied power by the power unit 5006, and the unit 5005 and other units are initialized. Consequently, the previous screen is again displayed on the display device 5105 based on the graphic data stored in the memory 5102, for example, the state before the powering off operation is resumed, thereby enabling the user to restart his operation.
Some of the Large Scale Integrated Circuits (LSIs) which have been recently used as a CPU, a memory, or a control unit for an external unit have a mode called low power mode or sleeping mode in which the LSIs do not operate actively, but just hold data by consuming a small amount of power. Such LSIs can be used to more easily extend the period of time that data is retained after a powering off operation, by using them in the low power mode after the powering off, and in the normal power mode after a powering back on.
Disclosed in U.S. Pat. No. 4,907,150 and others is a construction in which data stored in a memory or registers in the CPU is transferred to another memory backed up by a battery even though the power supply to the CPU or the memory is stopped by powering off. According to this approach, it becomes easier to select a high-speed or compact device as CPU or memory, without considering power demand.
For some programs, however, it is inconvenient to have the previous execution which was running before the powering off operation resumed by the resume function. For example, the UNIX operating system in which the process of printer spooler deamon initiated by "lpd" command holds the data to be outputted from the application program and the like to the printer, has the following problems.
(1) When the printer is powered off, printing operation can not restart properly unless the contents of the mode setting registers in the printer and of registers indicating the printing position on the paper at that moment are also resumed at the powering back on.
(2) When the system has been powered off during mechanical operation, the previous status is not always resumed by electric control at the powering back on.
(3) When the printer is shared by other computer systems, the paper which was being printed by one of the systems is ejected at the time the printer is used by another, which makes it impossible to restart printing on the same paper.
The same problems develop in hard disk drives which hold data in the internal registers and have mechanical operations. Especially in the hard disk drives having a buffer memory called disk cache, the application program and the like complete the writing operation to the drives when the data has transferred to the cache, so that the writing operation can never be performed even though the process status of the program is resumed.
Furthermore, all of the computer systems having the above construction need batteries, thereby making it difficult to reduce the product cost, weight, and size of the apparatus, and extend the capacity of the battery to retain the state in which a previous operation can be resumed.
Furthermore, such construction can not be applied to high-speed computer systems such as workstations, because they have a large power demand and many of the LSIs used for them do not have the above mentioned low power mode. Therefore, for example, a battery having the capacity to retain a resumable state of a personal computer for a week can retain that of a workstation only for an hour. Also, such computer systems having a large capacity of memory would require a large amount of power to retain the entire data in the low-demand memory to be transferred.
The limited resumable period of time creates a great restriction to the practical operations of workstations and other systems because they are mainly for business use so that it causes a severe damage to the users to lose stored data.